import java.util.Scanner;
public class test415 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter a letter: ");
        String input = scanner.next();
        if (input.length() == 1 && Character.isLetter(input.charAt(0))) {
            char ch = Character.toUpperCase(input.charAt(0));
            int number;
            if (ch >= 'A' && ch <= 'C') {
                number = 2;
            } else if (ch >= 'D' && ch <= 'F') {
                number = 3;
            } else if (ch >= 'G' && ch <= 'I') {
                number = 4;
            } else if (ch >= 'J' && ch <= 'L') {
                number = 5;
            } else if (ch >= 'M' && ch <= 'O') {
                number = 6;
            } else if (ch >= 'P' && ch <= 'S') {
                number = 7;
            } else if (ch >= 'T' && ch <= 'V') {
                number = 8;
            } else { // WXYZ
                number = 9;
            }
            System.out.println("The corresponding number is " + number);
        } else {
            System.out.println(input + " is an invalid input");
        }
        scanner.close();
    }
}
